home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / v cisle / htttrack / httrack-3.41-3.exe / {app} / src / htshelp.c < prev    next >
C/C++ Source or Header  |  2006-09-03  |  27KB  |  664 lines

  1. /* ------------------------------------------------------------ */
  2. /*
  3. HTTrack Website Copier, Offline Browser for Windows and Unix
  4. Copyright (C) Xavier Roche and other contributors
  5.  
  6. This program is free software; you can redistribute it and/or
  7. modify it under the terms of the GNU General Public License
  8. as published by the Free Software Foundation; either version 2
  9. of the License, or any later version.
  10.  
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  19.  
  20.  
  21. Important notes:
  22.  
  23. - We hereby ask people using this source NOT to use it in purpose of grabbing
  24. emails addresses, or collecting any other private information on persons.
  25. This would disgrace our work, and spoil the many hours we spent on it.
  26.  
  27.  
  28. Please visit our Website: http://www.httrack.com
  29. */
  30.  
  31.  
  32. /* ------------------------------------------------------------ */
  33. /* File: httrack.c subroutines:                                 */
  34. /*       command-line help system                               */
  35. /* Author: Xavier Roche                                         */
  36. /* ------------------------------------------------------------ */
  37.  
  38. /* Internal engine bytecode */
  39. #define HTS_INTERNAL_BYTECODE
  40.  
  41. #include "htshelp.h"
  42.  
  43. /* specific definitions */
  44. #include "htsbase.h"
  45. #include "htscoremain.h"
  46. #include "htscatchurl.h"
  47. #include "htslib.h"
  48. #include "htsalias.h"
  49. #include "htsmodules.h"
  50. #ifdef _WIN32
  51. #else
  52. #ifdef HAVE_UNISTD_H
  53. #include <unistd.h>
  54. #endif
  55. #endif
  56. /* END specific definitions */
  57.  
  58. #define waitkey if (more) { char s[4]; printf("\nMORE.. q to quit\n"); linput(stdin,s,4); if (strcmp(s,"q")==0) quit=1; else printf("Page %d\n\n",++m); }
  59. void infomsg(char* msg) {
  60.   int l=0;
  61.   int m=0;
  62.   int more=0;
  63.   int quit=0;
  64.   int done=0;
  65.   //
  66.   if (msg==NULL)
  67.     quit=0;
  68.   if (msg) {
  69.     if (!quit) {
  70.       if (strlen(msg)==1) {
  71.         if (msg[0]=='1') {
  72.           more=1;
  73.           return;
  74.         }
  75.       }
  76.  
  77.       /* afficher alias? */
  78.       if (((int)strlen(msg)) > 4) {
  79.         if (msg[0]==' ') {
  80.           if (msg[2]!=' ') {
  81.             if ((msg[3]==' ') || (msg[4]==' ')) {
  82.               char cmd[32]="-";
  83.               int p=0;
  84.               while(cmd[p]==' ') p++;
  85.               sscanf(msg+p,"%s",cmd+strlen(cmd));
  86.               /* clears cN -> c */
  87.               if ((p = (int) strlen(cmd))>2)
  88.                 if (cmd[p-1]=='N')
  89.                   cmd[p-1]='\0';
  90.               /* finds alias (if any) */
  91.               p=optreal_find(cmd);
  92.               if (p>=0) {
  93.                 /* fings type of parameter: number,param,param concatenated,single cmd */
  94.                 if (strcmp(opttype_value(p),"param") == 0)
  95.                   printf("%s (--%s[=N])\n",msg,optalias_value(p));
  96.                 else if (strcmp(opttype_value(p),"param1") == 0)
  97.                   printf("%s (--%s <param>)\n",msg,optalias_value(p));
  98.                 else if (strcmp(opttype_value(p),"param0") == 0)
  99.                   printf("%s (--%s<param>)\n",msg,optalias_value(p));
  100.                 else
  101.                   printf("%s (--%s)\n",msg,optalias_value(p));
  102.                 done=1;
  103.               }
  104.             }
  105.           }
  106.         }
  107.       }
  108.  
  109.       /* sinon */
  110.       if (!done)
  111.         printf("%s\n",msg);
  112.       l++;
  113.       if (l>20) {
  114.         l=0;
  115.         waitkey;
  116.       }
  117.     }
  118.   }
  119. }
  120. void help_wizard(httrackp* opt) {
  121.   char* urls = (char*) malloct(HTS_URLMAXSIZE*2);
  122.   char* mainpath = (char*) malloct(256);
  123.   char* projname = (char*) malloct(256);
  124.   char* stropt = (char*) malloct(2048);     // options
  125.   char* stropt2 = (char*) malloct(2048);    // options longues
  126.   char* strwild = (char*) malloct(2048);    // wildcards
  127.   char* cmd = (char*) malloct(4096);
  128.   char* str = (char*) malloct(256);
  129.   char** argv = (char**) malloct(256 * sizeof(char*));
  130.   //
  131.   char* a;
  132.   //
  133.   if (urls == NULL || mainpath == NULL || projname == NULL || stropt == NULL 
  134.     || stropt2 == NULL || strwild == NULL || cmd == NULL || str == NULL || argv == NULL) {
  135.     fprintf(stderr, "* memory exhausted in %s, line %d\n", __FILE__, __LINE__);
  136.     return;
  137.   }
  138.   urls[0] = mainpath[0] = projname[0] = stropt[0] = stropt2[0] = strwild[0] = cmd[0] = str[0] = '\0';
  139.   //
  140.   strcpybuff(stropt,"-");
  141.   mainpath[0]=projname[0]=stropt2[0]=strwild[0]='\0';
  142.   //
  143.   
  144.   printf("\n");
  145.   printf("Welcome to HTTrack Website Copier (Offline Browser) "HTTRACK_VERSION"%s\n", hts_get_version_info(opt));
  146.   printf("Copyright (C) Xavier Roche and other contributors\n");
  147. #ifdef _WIN32
  148.   printf("Note: You are running the commandline version,\n");
  149.   printf("run 'WinHTTrack.exe' to get the GUI version.\n");
  150. #endif
  151. #ifdef HTTRACK_AFF_WARNING
  152.   printf("NOTE: "HTTRACK_AFF_WARNING"\n");
  153. #endif
  154. #ifdef HTS_PLATFORM_NAME
  155. #if USE_BEGINTHREAD
  156.   printf("[compiled: "HTS_PLATFORM_NAME" - MT]\n");
  157. #else
  158.   printf("[compiled: "HTS_PLATFORM_NAME"]\n");
  159. #endif
  160. #endif
  161.   printf("To see the option list, enter a blank line or try httrack --help\n");
  162.   //
  163.   // Project name
  164.   while(strnotempty(projname)==0) {
  165.     printf("\n");
  166.     printf("Enter project name :");
  167.     fflush(stdout);
  168.     linput(stdin,projname,250);
  169.     if (strnotempty(projname)==0)
  170.       help("httrack",1);
  171.   }
  172.   //
  173.   // Path
  174.   if (strnotempty(hts_gethome()))
  175.     printf("\nBase path (return=%s/websites/) :",hts_gethome());
  176.   else
  177.     printf("\nBase path (return=current directory) :");
  178.   linput(stdin,str,250);
  179.   if (!strnotempty(str)) {
  180.     strcatbuff(str,hts_gethome());
  181.     strcatbuff(str,"/websites/");
  182.   }
  183.   if (strnotempty(str))
  184.   if ((str[strlen(str)-1]!='/') && (str[strlen(str)-1]!='\\'))
  185.     strcatbuff(str,"/");
  186.   strcatbuff(stropt2,"-O \""); strcatbuff(stropt2,str); strcatbuff(stropt2,projname); strcatbuff(stropt2,"\" ");
  187.   // CrΘer si ce n'est fait un index.html 1er niveau
  188.   make_empty_index(str);
  189.   //
  190.   printf("\n");
  191.   printf("Enter URLs (separated by commas or blank spaces) :");
  192.   fflush(stdout);
  193.   linput(stdin,urls,250);
  194.   if (strnotempty(urls)) {
  195.     while( (a=strchr(urls,',')) )  *a=' ';
  196.     while( (a=strchr(urls,'\t')) ) *a=' ';
  197.     
  198.     // Action
  199.     printf("\nAction:\n");
  200.     switch(help_query("Mirror Web Site(s)|Mirror Web Site(s) with Wizard|Just Get Files Indicated|Mirror ALL links in URLs (Multiple Mirror)|Test Links In URLs (Bookmark Test)|Update/Continue a Mirror",1)) {
  201.     case 1: break; 
  202.     case 2: strcatbuff(stropt,"W"); break;
  203.     case 3: strcatbuff(stropt2,"--get "); break;
  204.     case 4: strcatbuff(stropt2,"--mirrorlinks "); break;
  205.     case 5: strcatbuff(stropt2,"--testlinks "); break;
  206.     case 6: strcatbuff(stropt2,"--update "); break;
  207.     case 0: return; break;
  208.     }
  209.       
  210.     // Proxy
  211.     printf("\nProxy (return=none) :");
  212.     linput(stdin,str,250);
  213.     if (strnotempty(str)) {
  214.       while( (a=strchr(str,' ')) ) *a=':';    // port
  215.       if (!strchr(jump_identification(str),':')) {
  216.         char str2[256];
  217.         printf("\nProxy port (return=8080) :");
  218.         linput(stdin,str2,250);
  219.         strcatbuff(str,":");
  220.         if (strnotempty(str2)==0)
  221.           strcatbuff(str,"8080");
  222.         else
  223.           strcatbuff(str,str2);
  224.       }
  225.       strcatbuff(stropt2,"-P "); strcatbuff(stropt2,str); strcatbuff(stropt2," ");
  226.     }
  227.     
  228.     // Display
  229.     strcatbuff(stropt2," -%v ");
  230.  
  231.     // Wildcards
  232.     printf("\nYou can define wildcards, like: -*.gif +www.*.com/*.zip -*img_*.zip\n");
  233.     printf("Wildcards (return=none) :");
  234.     linput(stdin,strwild,250);
  235.     
  236.     // Options
  237.     do {
  238.       printf("\nYou can define additional options, such as recurse level (-r<number>), separed by blank spaces\n");
  239.       printf("To see the option list, type help\n");
  240.       printf("Additional options (return=none) :");
  241.       linput(stdin,str,250);
  242.       if (strfield2(str,"help")) {
  243.         help("httrack",2);
  244.       } else if (strnotempty(str)) {
  245.         strcatbuff(stropt2,str);
  246.         strcatbuff(stropt2," ");
  247.       }
  248.     } while(strfield2(str,"help"));
  249.     
  250.     {
  251.       int argc=1;
  252.       int g=0;
  253.       int i=0;
  254.       //
  255.       printf("\n");
  256.       if (strlen(stropt)==1)
  257.         stropt[0]='\0';    // aucune
  258.       sprintf(cmd,"%s %s %s %s",urls,stropt,stropt2,strwild);
  259.       printf("---> Wizard command line: httrack %s\n\n",cmd);
  260.       printf("Ready to launch the mirror? (Y/n) :");
  261.       fflush(stdout);
  262.       linput(stdin,str,250);
  263.       if (strnotempty(str)) {
  264.         if (!((str[0]=='y') || (str[0]=='Y')))
  265.           exit(0);
  266.       }
  267.       printf("\n");
  268.  
  269.       // couper en morceaux
  270.       argv[0]="winhttrack";
  271.       argv[1]=cmd;
  272.       argc++;    
  273.       while(cmd[i])  {
  274.         if(cmd[i]=='\"') g=!g;
  275.         if(cmd[i]==' '){
  276.           if(!g){
  277.             cmd[i]='\0';
  278.             argv[argc++]=cmd+i+1;
  279.           }
  280.         }  
  281.         i++;
  282.       }
  283.       hts_main(argc,argv);
  284.     }
  285.   //} else {
  286.   //  help("httrack",1);
  287.   }
  288.  
  289.   /* Free buffers */
  290.   freet(urls);
  291.   freet(mainpath);
  292.   freet(projname);
  293.   freet(stropt);
  294.   freet(stropt2);
  295.   freet(strwild);
  296.   freet(cmd);
  297.   freet(str);
  298. }
  299. int help_query(char* list,int def) {
  300.   char s[256];
  301.   char* a;
  302.   int opt;
  303.   int n=1;
  304.   a=list;
  305.   while(strnotempty(a)) {
  306.     char* b = strchr(a,'|');
  307.     if (b) {
  308.       char str[256];
  309.       str[0]='\0';
  310.       //
  311.       strncatbuff(str,a,(int) (b - a));
  312.       if (n==def)
  313.         printf("(enter)\t%d\t%s\n",n++,str);
  314.       else
  315.         printf("\t%d\t%s\n",n++,str);
  316.       a=b+1;
  317.     } else
  318.       a=list+strlen(list);
  319.   }
  320.   printf("\t0\tQuit");
  321.   do {
  322.     printf("\n: ");
  323.     fflush(stdout);
  324.     linput(stdin,s,250);
  325.   } while ((strnotempty(s)!=0) && (sscanf(s,"%d",&opt)!=1));
  326.   if (strnotempty(s))
  327.     return opt;
  328.   else
  329.     return def;
  330. }
  331.  
  332. // Capture d'URL
  333. void help_catchurl(const char* dest_path) {
  334.   char BIGSTK adr_prox[HTS_URLMAXSIZE*2];
  335.   int port_prox;
  336.   T_SOC soc=catch_url_init_std(&port_prox,adr_prox);
  337.   if (soc!=INVALID_SOCKET) {
  338.     char BIGSTK url[HTS_URLMAXSIZE*2];
  339.     char method[32];
  340.     char BIGSTK data[32768];
  341.     url[0]=method[0]=data[0]='\0';
  342.     //
  343.     printf("Okay, temporary proxy installed.\nSet your browser's preferences to:\n\n");
  344.     printf("\tProxy's address: \t%s\n\tProxy's port: \t%d\n",adr_prox,port_prox);
  345.     //
  346.     if (catch_url(soc,url,method,data)) {
  347.       char BIGSTK dest[HTS_URLMAXSIZE*2];
  348.       int i=0;
  349.       do {
  350.         sprintf(dest,"%s%s%d",dest_path,"hts-post",i);
  351.         i++;
  352.       } while(fexist(dest));
  353.       {
  354.         FILE* fp=fopen(dest,"wb");
  355.         if (fp) {
  356.           fwrite(data,strlen(data),1,fp);
  357.           fclose(fp);
  358.         }
  359.       }
  360.       // former URL!
  361.       {
  362.         char BIGSTK finalurl[HTS_URLMAXSIZE*2];
  363.         escape_check_url(dest);
  364.         sprintf(finalurl,"%s"POSTTOK"file:%s",url,dest);
  365.         printf("\nThe URL is: \"%s\"\n",finalurl);
  366.         printf("You can capture it through: httrack \"%s\"\n",finalurl);
  367.       }
  368.     } else
  369.       printf("Unable to analyse the URL\n");
  370. #ifdef _WIN32
  371.     closesocket(soc);
  372. #else
  373.     close(soc);
  374. #endif
  375.   } else
  376.     printf("Unable to create a temporary proxy (no remaining port)\n");
  377. }
  378.  
  379. // CrΘer un index.html vide
  380. void make_empty_index(char* str) {
  381. #if 0
  382.   if (!fexist(fconcat(str,"index.html"))) {
  383.     FILE* fp=fopen(fconcat(str,"index.html"),"wb");
  384.     if (fp) {
  385.       fprintf(fp,"<!-- "HTS_TOPINDEX" -->"CRLF);
  386.       fprintf(fp,"<HTML><BODY>Index is empty!<BR>(File used to index all HTTrack projects)</BODY></HTML>"CRLF);
  387.       fclose(fp);
  388.     }
  389.   }
  390. #endif
  391. }
  392.  
  393. // mini-aide  (h: help)
  394. //           y
  395. void help(char* app,int more) {
  396.   char info[2048];
  397.   infomsg("");
  398.   if (more)
  399.     infomsg("1");
  400.   if (more != 2) {
  401.     sprintf(info, "HTTrack version "HTTRACK_VERSION"%s (compiled "__DATE__")", hts_is_available());
  402.     infomsg(info);
  403. #ifdef HTTRACK_AFF_WARNING
  404.     infomsg("NOTE: "HTTRACK_AFF_WARNING);
  405. #endif
  406.     sprintf(info,"\tusage: %s <URLs> [-option] [+<URL_FILTER>] [-<URL_FILTER>] [+<mime:MIME_FILTER>] [-<mime:MIME_FILTER>]",app);
  407.     infomsg(info);
  408.     infomsg("\twith options listed below: (* is the default value)");
  409.     infomsg("");
  410.   }
  411.   infomsg("General options:");
  412.   infomsg("  O  path for mirror/logfiles+cache (-O path_mirror[,path_cache_and_logfiles])");
  413. #ifndef _WIN32
  414.   infomsg(" %O  chroot path to, must be r00t (-%O root_path)");
  415. #endif
  416.   infomsg("");
  417.   infomsg("Action options:");
  418.   infomsg("  w *mirror web sites");
  419.   infomsg("  W  mirror web sites, semi-automatic (asks questions)");
  420.   infomsg("  g  just get files (saved in the current directory)");
  421.   infomsg("  i  continue an interrupted mirror using the cache");
  422.   infomsg("  Y   mirror ALL links located in the first level pages (mirror links)");
  423.   infomsg("");
  424.   infomsg("Proxy options:");
  425.   infomsg("  P  proxy use (-P proxy:port or -P user:pass@proxy:port)");
  426.   infomsg(" %f *use proxy for ftp (f0 don't use)");
  427.   infomsg(" %b  use this local hostname to make/send requests (-%b hostname)");
  428.   infomsg("");
  429.   infomsg("Limits options:");
  430.   infomsg("  rN set the mirror depth to N (* r9999)");
  431.   infomsg(" %eN set the external links depth to N (* %e0)");
  432.   infomsg("  mN maximum file length for a non-html file");
  433.   infomsg("  mN,N2 maximum file length for non html (N) and html (N2)");
  434.   infomsg("  MN maximum overall size that can be uploaded/scanned");
  435.   infomsg("  EN maximum mirror time in seconds (60=1 minute, 3600=1 hour)");
  436.   infomsg("  AN maximum transfer rate in bytes/seconds (1000=1KB/s max)");
  437.   infomsg(" %cN maximum number of connections/seconds (*%c10)");
  438.   infomsg("  GN pause transfer if N bytes reached, and wait until lock file is deleted");
  439. #if HTS_USEMMS
  440.   infomsg(" %mN maximum mms stream download time in seconds (60=1 minute, 3600=1 hour)");
  441. #endif
  442.   infomsg("");
  443.   infomsg("Flow control:");
  444.   infomsg("  cN number of multiple connections (*c8)");
  445.   infomsg("  TN timeout, number of seconds after a non-responding link is shutdown");
  446.   infomsg("  RN number of retries, in case of timeout or non-fatal errors (*R1)");
  447.   infomsg("  JN traffic jam control, minimum transfert rate (bytes/seconds) tolerated for a link");
  448.   infomsg("  HN host is abandonned if: 0=never, 1=timeout, 2=slow, 3=timeout or slow");
  449.   infomsg("");
  450.   infomsg("Links options:");
  451.   infomsg(" %P *extended parsing, attempt to parse all links, even in unknown tags or Javascript (%P0 don't use)");
  452.   infomsg("  n  get non-html files 'near' an html file (ex: an image located outside)");
  453.   infomsg("  t  test all URLs (even forbidden ones)");
  454.   infomsg(" %L <file> add all URL located in this text file (one URL per line)");
  455.   infomsg(" %S <file> add all scan rules located in this text file (one scan rule per line)");
  456.   infomsg("");
  457.   infomsg("Build options:");
  458.   infomsg("  NN structure type (0 *original structure, 1+: see below)");
  459.   infomsg("     or user defined structure (-N \"%h%p/%n%q.%t\")");
  460.   infomsg(" %N  delayed type check, don't make any link test but wait for files download to start instead (experimental) (%N0 don't use, %N1 use for unknown extensions, * %N2 always use)");
  461.   infomsg(" %D  cached delayed type check, don't wait for remote type during updates, to speedup them (%D0 wait, * %D1 don't wait)");
  462.   infomsg(" %M  generate a RFC MIME-encapsulated full-archive (.mht)");
  463.   infomsg("  LN long names (L1 *long names / L0 8-3 conversion / L2 ISO9660 compatible)");
  464.   infomsg("  KN keep original links (e.g. http://www.adr/link) (K0 *relative link, K absolute links, K4 original links, K3 absolute URI links)");
  465.   infomsg("  x  replace external html links by error pages");
  466.   infomsg(" %x  do not include any password for external password protected websites (%x0 include)");
  467.   infomsg(" %q *include query string for local files (useless, for information purpose only) (%q0 don't include)");
  468.   infomsg("  o *generate output html file in case of error (404..) (o0 don't generate)");
  469.   infomsg("  X *purge old files after update (X0 keep delete)");
  470.   infomsg(" %p  preserve html files 'as is' (identical to '-K4 -%F \"\"')");
  471.   infomsg("");
  472.   infomsg("Spider options:");
  473.   infomsg("  bN accept cookies in cookies.txt (0=do not accept,* 1=accept)");
  474.   infomsg("  u  check document type if unknown (cgi,asp..) (u0 don't check, * u1 check but /, u2 check always)");
  475.   infomsg("  j *parse Java Classes (j0 don't parse, bitmask: |1 parse default, |2 don't parse .class |4 don't parse .js |8 don't be aggressive)");
  476.   infomsg("  sN follow robots.txt and meta robots tags (0=never,1=sometimes,* 2=always, 3=always (even strict rules))");
  477.   infomsg(" %h  force HTTP/1.0 requests (reduce update features, only for old servers or proxies)");
  478.   infomsg(" %k  use keep-alive if possible, greately reducing latency for small files and test requests (%k0 don't use)");
  479.   infomsg(" %B  tolerant requests (accept bogus responses on some servers, but not standard!)");
  480.   infomsg(" %s  update hacks: various hacks to limit re-transfers when updating (identical size, bogus response..)");
  481.   infomsg(" %u  url hacks: various hacks to limit duplicate URLs (strip //, www.foo.com==foo.com..)");
  482.   infomsg(" %A  assume that a type (cgi,asp..) is always linked with a mime type (-%A php3,cgi=text/html;dat,bin=application/x-zip)");
  483.   infomsg("     shortcut: '--assume standard' is equivalent to -%A "HTS_ASSUME_STANDARD);
  484.   infomsg("     can also be used to force a specific file type: --assume foo.cgi=text/html");
  485.   infomsg(" @iN internet protocol (0=both ipv6+ipv4, 4=ipv4 only, 6=ipv6 only)");
  486.   infomsg(" %w  disable a specific external mime module (-%w htsswf -%w htsjava)");
  487.   infomsg("");
  488.   infomsg("Browser ID:");
  489.   infomsg("  F  user-agent field sent in HTTP headers (-F \"user-agent name\")");
  490.   infomsg(" %R  default referer field sent in HTTP headers");
  491.   infomsg(" %E  from email address sent in HTTP headers");
  492.   infomsg(" %F  footer string in Html code (-%F \"Mirrored [from host %s [file %s [at %s]]]\"");
  493.   infomsg(" %l  preffered language (-%l \"fr, en, jp, *\"");
  494.   infomsg("");
  495.   infomsg("Log, index, cache");
  496.   infomsg("  C  create/use a cache for updates and retries (C0 no cache,C1 cache is prioritary,* C2 test update before)");
  497.   infomsg("  k  store all files in cache (not useful if files on disk)");
  498.   infomsg(" %n  do not re-download locally erased files");
  499.   infomsg(" %v  display on screen filenames downloaded (in realtime) - * %v1 short version - %v2 full animation");
  500.   infomsg("  Q  no log - quiet mode");
  501.   infomsg("  q  no questions - quiet mode");
  502.   infomsg("  z  log - extra infos");
  503.   infomsg("  Z  log - debug");
  504.   infomsg("  v  log on screen");
  505.   infomsg("  f *log in files");
  506.   infomsg("  f2 one single log file");
  507.   infomsg("  I *make an index (I0 don't make)");
  508.   infomsg(" %i  make a top index for a project folder (* %i0 don't make)");
  509.   infomsg(" %I  make an searchable index for this mirror (* %I0 don't make)");
  510.   infomsg("");
  511.   infomsg("Expert options:");
  512.   infomsg("  pN priority mode: (* p3)");
  513.   infomsg("      p0 just scan, don't save anything (for checking links)");
  514.   infomsg("      p1 save only html files");
  515.   infomsg("      p2 save only non html files");
  516.   infomsg("     *p3 save all files");
  517.   infomsg("      p7 get html files before, then treat other files");
  518.   infomsg("  S  stay on the same directory");
  519.   infomsg("  D *can only go down into subdirs");    
  520.   infomsg("  U  can only go to upper directories");
  521.   infomsg("  B  can both go up&down into the directory structure");
  522.   infomsg("  a *stay on the same address");
  523.   infomsg("  d  stay on the same principal domain");
  524.   infomsg("  l  stay on the same TLD (eg: .com)");
  525.   infomsg("  e  go everywhere on the web");
  526.   infomsg(" %H  debug HTTP headers in logfile");
  527.   infomsg("");
  528.   infomsg("Guru options: (do NOT use if possible)");
  529.   infomsg(" #X *use optimized engine (limited memory boundary checks)");
  530.   infomsg(" #0  filter test (-#0 '*.gif' 'www.bar.com/foo.gif')");
  531.   infomsg(" #1  simplify test (-#1 ./foo/bar/../foobar)");
  532.   infomsg(" #2  type test (-#2 /foo/bar.php)");
  533.   infomsg(" #C  cache list (-#C '*.com/spider*.gif'");
  534.   infomsg(" #R  cache repair (damaged cache)");
  535.   infomsg(" #d  debug parser");
  536.   infomsg(" #E  extract new.zip cache meta-data in meta.zip");
  537.   infomsg(" #f  always flush log files");
  538.   infomsg(" #FN maximum number of filters");
  539.   infomsg(" #h  version info");
  540.   infomsg(" #K  scan stdin (debug)");
  541.   infomsg(" #L  maximum number of links (-#L1000000)");
  542.   infomsg(" #p  display ugly progress information");
  543.   infomsg(" #P  catch URL");
  544.   infomsg(" #R  old FTP routines (debug)");
  545.   infomsg(" #T  generate transfer ops. log every minutes");
  546.   infomsg(" #u  wait time");
  547.   infomsg(" #Z  generate transfer rate statictics every minutes");
  548.   infomsg(" #!  execute a shell command (-#! \"echo hello\")");
  549.   infomsg("");
  550.   infomsg("Dangerous options: (do NOT use unless you exactly know what you are doing)");
  551.   infomsg(" %!  bypass built-in security limits aimed to avoid bandwith abuses (bandwidth, simultaneous connections)");
  552.   infomsg("     IMPORTANT NOTE: DANGEROUS OPTION, ONLY SUITABLE FOR EXPERTS");
  553.   infomsg("                     USE IT WITH EXTREME CARE");
  554.   infomsg("");
  555.   infomsg("Command-line specific options:");
  556.   infomsg("  V execute system command after each files ($0 is the filename: -V \"rm \\$0\")");
  557.   infomsg(" %U run the engine with another id when called as root (-%U smith)");
  558.   infomsg(" %W use an external library function as a wrapper (-%W myfoo.so[,myparameters])");
  559.   /* infomsg(" %O do a chroot before setuid"); */
  560.   infomsg("");
  561.   infomsg("Details: Option N");
  562.   infomsg("  N0 Site-structure (default)");
  563.   infomsg("  N1 HTML in web/, images/other files in web/images/");
  564.   infomsg("  N2 HTML in web/HTML, images/other in web/images");
  565.   infomsg("  N3 HTML in web/,  images/other in web/");
  566.   infomsg("  N4 HTML in web/, images/other in web/xxx, where xxx is the file extension (all gif will be placed onto web/gif, for example)");
  567.   infomsg("  N5 Images/other in web/xxx and HTML in web/HTML");
  568.   infomsg("  N99 All files in web/, with random names (gadget !)");
  569.   infomsg("  N100 Site-structure, without www.domain.xxx/");
  570.   infomsg("  N101 Identical to N1 exept that \"web\" is replaced by the site's name");
  571.   infomsg("  N102 Identical to N2 exept that \"web\" is replaced by the site's name");
  572.   infomsg("  N103 Identical to N3 exept that \"web\" is replaced by the site's name");
  573.   infomsg("  N104 Identical to N4 exept that \"web\" is replaced by the site's name");
  574.   infomsg("  N105 Identical to N5 exept that \"web\" is replaced by the site's name");
  575.   infomsg("  N199 Identical to N99 exept that \"web\" is replaced by the site's name");
  576.   infomsg("  N1001 Identical to N1 exept that there is no \"web\" directory");
  577.   infomsg("  N1002 Identical to N2 exept that there is no \"web\" directory");
  578.   infomsg("  N1003 Identical to N3 exept that there is no \"web\" directory (option set for g option)");
  579.   infomsg("  N1004 Identical to N4 exept that there is no \"web\" directory");
  580.   infomsg("  N1005 Identical to N5 exept that there is no \"web\" directory");
  581.   infomsg("  N1099 Identical to N99 exept that there is no \"web\" directory");
  582.   infomsg("Details: User-defined option N");
  583.   infomsg("  '%n' Name of file without file type (ex: image)");
  584.   infomsg("  '%N' Name of file, including file type (ex: image.gif)");
  585.   infomsg("  '%t' File type (ex: gif)");
  586.   infomsg("  '%p' Path [without ending /] (ex: /someimages)");
  587.   infomsg("  '%h' Host name (ex: www.someweb.com)");
  588.   infomsg("  '%M' URL MD5 (128 bits, 32 ascii bytes)");
  589.   infomsg("  '%Q' query string MD5 (128 bits, 32 ascii bytes)");
  590.   infomsg("  '%r' protocol name (ex: http)");
  591.   infomsg("  '%q' small query string MD5 (16 bits, 4 ascii bytes)");
  592.   infomsg("     '%s?' Short name version (ex: %sN)");
  593.   infomsg("  '%[param]' param variable in query string");
  594.     infomsg("  '%[param:before:after:empty:notfound]' advanced variable extraction");
  595.   infomsg("Details: User-defined option N and advanced variable extraction");
  596.     infomsg("   %[param:before:after:empty:notfound]");
  597.   infomsg("   param : parameter name");
  598.   infomsg("   before : string to prepend if the parameter was found");
  599.   infomsg("   after : string to append if the parameter was found");
  600.   infomsg("   notfound : string replacement if the parameter could not be found");
  601.   infomsg("   empty : string replacement if the parameter was empty");
  602.   infomsg("   all fields, except the first one (the parameter name), can be empty");
  603.   infomsg("");
  604.   infomsg("Details: Option K");
  605.   infomsg("  K0  foo.cgi?q=45  ->  foo4B54.html?q=45 (relative URI, default)");
  606.   infomsg("  K                 ->  http://www.foobar.com/folder/foo.cgi?q=45 (absolute URL)");
  607.   infomsg("  K4                ->  foo.cgi?q=45 (original URL)");
  608.   infomsg("  K3                ->  /folder/foo.cgi?q=45 (absolute URI)");
  609.   infomsg("");
  610.   infomsg("Shortcuts:");
  611.   infomsg("--mirror      <URLs> *make a mirror of site(s) (default)");
  612.   infomsg("--get         <URLs>  get the files indicated, do not seek other URLs (-qg)");
  613.   infomsg("--list   <text file>  add all URL located in this text file (-%L)");
  614.   infomsg("--mirrorlinks <URLs>  mirror all links in 1st level pages (-Y)");
  615.   infomsg("--testlinks   <URLs>  test links in pages (-r1p0C0I0t)");
  616.   infomsg("--spider      <URLs>  spider site(s), to test links: reports Errors & Warnings (-p0C0I0t)");
  617.   infomsg("--testsite    <URLs>  identical to --spider");
  618.   infomsg("--skeleton    <URLs>  make a mirror, but gets only html files (-p1)");
  619.   infomsg("--update              update a mirror, without confirmation (-iC2)");
  620.   infomsg("--continue            continue a mirror, without confirmation (-iC1)");
  621.   infomsg("");
  622.   infomsg("--catchurl            create a temporary proxy to capture an URL or a form post URL");
  623.   infomsg("--clean               erase cache & log files");
  624.   infomsg("");
  625.   infomsg("--http10              force http/1.0 requests (-%h)");
  626.   infomsg("");
  627.   infomsg("Details: Option %W: External callbacks prototypes");
  628.   infomsg("see htsdefines.h");
  629.   infomsg("");
  630.   infomsg("example: httrack www.someweb.com/bob/");
  631.   infomsg("means:   mirror site www.someweb.com/bob/ and only this site");
  632.   infomsg("");
  633.   infomsg("example: httrack www.someweb.com/bob/ www.anothertest.com/mike/ +*.com/*.jpg -mime:application/*");
  634.   infomsg("means:   mirror the two sites together (with shared links) and accept any .jpg files on .com sites");
  635.   infomsg("");
  636.   infomsg("example: httrack www.someweb.com/bob/bobby.html +* -r6");
  637.   infomsg("means get all files starting from bobby.html, with 6 link-depth, and possibility of going everywhere on the web");
  638.   infomsg("");
  639.   infomsg("example: httrack www.someweb.com/bob/bobby.html --spider -P proxy.myhost.com:8080");
  640.   infomsg("runs the spider on www.someweb.com/bob/bobby.html using a proxy");
  641.   infomsg("");
  642.   infomsg("example: httrack --update");
  643.   infomsg("updates a mirror in the current folder");
  644.   infomsg("");
  645.   infomsg("example: httrack");
  646.   infomsg("will bring you to the interactive mode");
  647.   infomsg("");
  648.   infomsg("example: httrack --continue");
  649.   infomsg("continues a mirror in the current folder");
  650.   infomsg("");
  651.   sprintf(info, "HTTrack version "HTTRACK_VERSION"%s (compiled "__DATE__")", hts_is_available());
  652.   infomsg(info);
  653.   infomsg("Copyright (C) Xavier Roche and other contributors");
  654. #ifdef HTS_PLATFORM_NAME
  655.   infomsg("[compiled: "HTS_PLATFORM_NAME"]");
  656. #endif
  657.   infomsg(NULL);
  658.  
  659. //  infomsg("  R  *relative links (e.g ../link)\n");
  660. //  infomsg("  A   absolute links (e.g /www.adr/link)\n");
  661. }
  662.  
  663.  
  664.